const Application = require("egg").Application
let path = require("path")
// console.log(__dirname)
let baseDir = path.resolve(path.join(__dirname, "../")
)
const app = new Application({
	framework: path.join(baseDir, "./node_modules/egg"),
	baseDir: baseDir,
	workers: 1,
	plugins: null,
	https: false,
	isDebug: true,
	clusterPort: 39257,
	port: 7002,
})
const server = require("http").createServer(app.callback())//.listen(7002)
// console.log("mysql" + app.config.sequelize)
app.ready(function () {
	server.emit("listening")
	app.redis.set("system", baseDir)
})
module.exports = {server, app}
//ndb --inspect-brk  ./test/application.js
//ndb  ./test/application.js